package com.cyd.demo3.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description : 类描述
 * Created by cyd on 2021-05-11 20:22:38
 */
public class OneServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 1.读取请求url
        String url = req.getRequestURL().toString();
        // 2.读取请求方式
        String reqMethod = req.getMethod();

        System.out.println("url:" + url);
        System.out.println("reqMethod:" + reqMethod);

        // 3.获取资源文件定位符
        String uri = req.getRequestURI();
        System.out.println("uri:" + uri);
        
    }
}
